function distr=genfake(row,dominant,dominated)

r=length(row);
distr=zeros(r,3);

for i=1:r
    sdominant=find(dominant(i,:));
    sdominated=find(dominated(i,:));
    
    n=length(sdominant);
    if n>0
        for j=1:10000
            x=rand(1,3);
            x=x./sum(x);
            if x(sdominant)>1/3
                break
            end
        end
        distr(i,:)=x;
        clear x
        
    elseif n==0
        m=length(sdominated);
        if m>0
            for j=1:10000
                y=rand(1,3);
                y=y./sum(y);
                if y(sdominated)<1/3
                    break
                end
            end
        
        distr(i,:)=y;
        clear y
        end
        
        if m==0
            distr(i,:)=rand(1,3);
            distr(i,:)=distr(i,:)./sum(distr(i,:));
        end
        
    else
        distr(i,:)=rand(1,3);
        distr(i,:)=distr(i,:)./sum(distr(i,:));
    end
end




